home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
vidtyp14.zip
/
VIDTYP14.DOC
< prev
next >
Wrap
Text File
|
1990-02-26
|
21KB
|
454 lines
VIDTYPE Ver 1.4 Copyright 1990 by SERVITEK SOFTWARE.
________________ All rights reserved. Revised 02-05-90.
If you find this useful, a $5 contribution would be appreciated.
Please send it to: CHANGE OF ADDRESS!
NEW ADDRESS: (OLD ADDRESS: )
SERVITEK SOFTWARE (Vince Deegan )
PO BOX 280581 (PO BOX 180114 )
Dallas, TX 75228-9181 (Dallas, TX 75218)
Thank you
For local area networks, refer to ORDER.FRM on liscensing fee.
VIDTYPE is a utility that detects the type of video adaptor, row
and column mode, and system (IBM PC/XT/AT/PS2) that you are using
and automatically sets up DOS environment variables or an
errorlevel that represents the description of those equipment
types. This should work with %100 clones, also. In a DOS batch
file, a DOS environment variable can be examined when using the
IF statement with the % symbol at each end of the variable. An
errorlevel can be checked when using the IF and ERRLORLEVEL
statements.
One good use of VIDTYPE is when you want to run applications that
give you a selection of video-driver-files or set-files and you
want to have the necessary video-driver-file or set-file chosen
automatically before calling the application. In other words, you
can write a batch file that uses the DOS-batch-language IF
statement and either the % symbol or ERRORLEVEL statement to
examine the DOS environment variable and/or errorlevel created by
VIDTYPE. Then, depending on which IF statement is true, the batch
file can copy the needed video-driver-file or set-file to the
default driver-file or set-file used by the application.
In some cases, using a DOS variable can interfere with some DOS
operations that depend on the use of the DOS environment space.
If this ever occurs with you, you can choose to refrain from
using DOS variables and, instead, use an errorlevel to detect the
type of equipment being used.
Make this choice carefully, though, since the advantage to using
a DOS variable as opposed to an errorlevel is that it only needs
to be set once and VIDTYPE only needs to be called once at the
start-up of your system, within the autoexec.bat file. The
errorlevel needs to be checked immediately after VIDTYPE is
executed requiring VIDTYPE to be called in each batch file that
determines a video-driver-file or set-file for an application.
That's not all that bad, but remember also, when using an
errorlevel, your batch files can become pretty lengthy if you are
going to test for all of the possible choices of equipment.
The use of DOS variables allows you ways of writing smaller and
more clever batch files. So my suggestion would be always to
choose the use of a DOS variable unless you have problems with
your DOS environment space, such as when using very large batch
files whose pointers are kept in the DOS environment space or
when using hardware that isn't hardware-compatible with IBM.
Format: VIDTYPE [-V] [+E] [+S] [+SYS] [+P] [Variable name] [Debug]
OR VIDTYPE NP > PRN
(Prints help with no pause)
-V : This option tells the program not to use DOS variables.
(The default setting is for DOS variables to be used.)
+E : This option tells the program to set an errorlevel.
+S : This option will cause VIDTYPE to assign a shorter
description to the DOS variable (shown in the chart
displayed in the on-line help).
Variable name : This is the user-defined name that will be used
for the video DOS variable if the -V option
isn't used. When a video DOS variable is used,
row and column DOS variables will automatically
be created in addition to the video variable.
+SYS : This option tells the program to include the system
variable with its system description.
+P : This option tells the program to prompt the user when a
CGA adaptor is detected in order to find out whether a
multi-color monitor or single-color monitor is hooked
up.
========================== SOME EXAMPLES ==========================
-----------------------
VIDEO-ADAPTOR DETECTION:
-----------------------
Say you want to call Lotus 123 where the default set-file is
called 123.SET and your set-file for using a CGA video adaptor is
called CGACOLOR.SET . . .
--------------------------------------------------
EXAMPLE for using a DOS variable for video adaptor:
--------------------------------------------------
- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the video type:
VIDTYPE VIDEO
VIDTYPE will create a DOS environment variable called
VIDEO and give it a string value that describes the type
of video adaptor your system is using, according to the
VIDTYPE chart. (Get a printout of the chart by typing
VIDTYPE NP > PRN.) It will also create two other DOS
variables called ROW and COL that give the current number
of rows and columns being used, respectively.
- Now you can write another batch file to use for calling Lotus
123.
Example: IF %VIDEO% == CGACOLOR COPY CGACOLOR.SET 123.SET
IF %VIDEO% . . . . . . .
IF %VIDEO% . . . . . . .
123
This calls Lotus 123 after copying the needed set-file to
the default set-file.
OR if your application can be called along with the name
of the desired set-file (or driver-file) you can be more
clever in your batch file.
Example: 123 %VIDEO%
This calls Lotus 123 and tells it to use the string value
in the VIDEO variable as the actual set-file name to be
used. I.e. If VIDEO has the string value CGACOLOR, Lotus,
which assumes that the file name has .SET as its
extension, will use CGACOLOR.SET as its set-file.
NOTE: If the +S option was used, the string would have
been CGA instead of CGACOLOR. This could let the variable
serve as a prefix to a file-name. I.e. If you had a
set-file called CGA123.SET, you could type 123 %VIDEO%123
which would be translated as 123 CGA123.SET.
NOTE: If you need to know the current row and column mode
that the system is using, just access the ROW and COL
variables in the same way you accessed the VIDEO variable;
i.e. IF %ROW% == . . . .
IF %COL% == . . . .
NOTE: I have found that if you are using one of the many DOS
shell programs available, you may encounter a problem when
running a batch file that tries to access the DOS variables,
while in the DOS shell program. It may not recognize these
variables as part of the "current" DOS environment since the
variables are in the "master" environment. This problem can be
solved by not running the batch file while in the DOS shell
program. Just run it out in plain ole DOS (the "mas